• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 08:48
CEST 14:48
KST 21:48
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL19] Finals Recap: Standing Tall9HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Flash Announces Hiatus From ASL62Weekly Cups (June 23-29): Reynor in world title form?13FEL Cracov 2025 (July 27) - $8000 live event21Esports World Cup 2025 - Final Player Roster16Weekly Cups (June 16-22): Clem strikes back1
StarCraft 2
General
Program: SC2 / XSplit / OBS Scene Switcher The SCII GOAT: A statistical Evaluation Statistics for vetoed/disliked maps Weekly Cups (June 23-29): Reynor in world title form? PiG Sty Festival #5: Playoffs Preview + Groups Recap
Tourneys
RSL: Revival, a new crowdfunded tournament series Sparkling Tuna Cup - Weekly Open Tournament WardiTV Mondays FEL Cracov 2025 (July 27) - $8000 live event Korean Starcraft League Week 77
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma Mutation # 477 Slow and Steady
Brood War
General
Player “Jedi” cheat on CSL SC uni coach streams logging into betting site Flash Announces Hiatus From ASL Practice Partners (Official) ASL20 Preliminary Maps
Tourneys
[BSL20] Grand Finals - Sunday 20:00 CET [Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL20] GosuLeague RO16 - Tue & Wed 20:00+CET
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread Nintendo Switch Thread What do you want from future RTS games? Beyond All Reason
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Summer Games Done Quick 2025! Trading/Investing Thread Things Aren’t Peaceful in Palestine
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Blogs
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 626 users

The Big Programming Thread - Page 603

Forum Index > General Forum
Post a Reply
Prev 1 601 602 603 604 605 1031 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
March 08 2015 12:24 GMT
#12041
On March 08 2015 21:00 sabas123 wrote:
My idea was to have some kind of sorter that will do the filter and then give that to the function/system/processor (how ever you want to call it).

My intention isn't performance, but from what I read it should be possible to have faster performance with this kind of architecture then the traditional class hierarchy

The point of entity component designs is something along the lines of avoiding having to define a class for each possible combination of traits an object could have (like renderable, collidable, controllable and so on). It's about using composition instead of inheritance. It's not about performance and it's very unlikely that it has any performance advantages over a inheritance based system in a language like C++ simply because C++ virtual method invocation is about as fast as it gets if you need variable behavior among a list of objects.

In other languages this might be entirely different, specifically if methods aren't defined per class, but instead per instance. In that case you'd only ever need the methods of your few system instances instead of your many entity instances.
If you have a good reason to disagree with the above, please tell me. Thank you.
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
March 08 2015 12:32 GMT
#12042
On March 08 2015 21:24 spinesheath wrote:
Show nested quote +
On March 08 2015 21:00 sabas123 wrote:
My idea was to have some kind of sorter that will do the filter and then give that to the function/system/processor (how ever you want to call it).

My intention isn't performance, but from what I read it should be possible to have faster performance with this kind of architecture then the traditional class hierarchy

The point of entity component designs is something along the lines of avoiding having to define a class for each possible combination of traits an object could have (like renderable, collidable, controllable and so on). It's about using composition instead of inheritance. It's not about performance and it's very unlikely that it has any performance advantages over a inheritance based system in a language like C++ simply because C++ virtual method invocation is about as fast as it gets if you need variable behavior among a list of objects.

In other languages this might be entirely different, specifically if methods aren't defined per class, but instead per instance. In that case you'd only ever need the methods of your few system instances instead of your many entity instances.

I saw some speakers at cpp con from google and sony I think talk about how to stepped to data oriented designs (from my knowledge entity based systems == DoD) because it had better performance and more maintainable code.
The harder it becomes, the more you should focus on the basics.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2015-03-08 15:48:27
March 08 2015 15:47 GMT
#12043
On March 08 2015 21:32 sabas123 wrote:
Show nested quote +
On March 08 2015 21:24 spinesheath wrote:
On March 08 2015 21:00 sabas123 wrote:
My idea was to have some kind of sorter that will do the filter and then give that to the function/system/processor (how ever you want to call it).

My intention isn't performance, but from what I read it should be possible to have faster performance with this kind of architecture then the traditional class hierarchy

The point of entity component designs is something along the lines of avoiding having to define a class for each possible combination of traits an object could have (like renderable, collidable, controllable and so on). It's about using composition instead of inheritance. It's not about performance and it's very unlikely that it has any performance advantages over a inheritance based system in a language like C++ simply because C++ virtual method invocation is about as fast as it gets if you need variable behavior among a list of objects.

In other languages this might be entirely different, specifically if methods aren't defined per class, but instead per instance. In that case you'd only ever need the methods of your few system instances instead of your many entity instances.

I saw some speakers at cpp con from google and sony I think talk about how to stepped to data oriented designs (from my knowledge entity based systems == DoD) because it had better performance and more maintainable code.

Data oriented design seems to be about placing similar data in a contiguous part of memory so it can be mass-processed more efficiently.

If a normal class has fields a, b and c, each instance looks just about like this in memory: (x, a, b, c) where x is, for example, the v-table pointer. And then those instances are potentially sprinkled all across your memory. That's "bad" if you want to do an operation on all fields a of all instances.

DoD suggests that instead of having fields a, b and c per instance, you have for example 3 vectors for the class - not the instance, one for each field, and if you need to access the "field" of a given instance, you look it up by index, for example. The key point being that all fields "a" are placed in contiguous memory.
I worked with something like that for my bachelor's thesis, but I still had normal instances and only copied the data into vectors before using it. The idea there was to lay the data out in a way that allows better usage of SIMD instructions. However this was for a molecular dynamics simulation on a supercomputer. Hardly the kind of performance requirements you'll face everyday.

Now, what you are doing - a list of components for each entity instance, and each component is an instance with normal fields: That's not DoD. You might be able to use a data holder like described in DoD for each kind of component and it'll be DoD, but as of now you're not doing that, and I wouldn't recommend it. For example because you'll have to do a lot more than just change your data storage layout to achieve a performance gain. And you more than likely won't need it.
If you have a good reason to disagree with the above, please tell me. Thank you.
netherh
Profile Blog Joined November 2011
United Kingdom333 Posts
March 08 2015 16:59 GMT
#12044
On March 08 2015 15:30 nunez wrote:
what is the point of this component / entity based
design? i get a consistent handle to something for
the price of having all my types inherit from some
useless baseclass? i can get a consitent handle for
something wihtout paying that price. i'm not sure
i understand it at all.

and if you are storing stuff via pointer, sure the owners,
of the pointer are stacked up nicely in your blob of
memory but you have no guarantee that the objects they
own are. so when you iterate over the collection, you
are still jumping all over the place in memory.


Indeed. Component-based entities are all about reducing code complexity. They make it easier to add a wide range of things (data and behaviour) to a game. They also make serialisation easier. That base class can (and arguably should) be completely hidden inside the entity.

Iteration over contiguous memory is certainly faster. But it's an optimisation, and so has other costs. You also need to be very careful to know exactly what your access patterns and usage are in order to know exactly what, and how to optimise. You can't optimise everything -> you need to know whether you need fast lookup, fast iteration, or fast (or any) sorting.

What I've outlined is flexible and extensible, and if you need to make a specific aspect or system faster it's easy to do so, without even touching any of the "client code" (gameplay code that actually uses the entities).

@spinesheath: Yeah, the type casting isn't ideal. But the alternative would probably be getting components from the systems directly (since they'd know the type). And then you'd be looking through every component of a particular type for the right entity id, instead of looking through perhaps 3 or 4 components of different types and doing one type cast. I haven't measured which is faster (and it would depend entirely on one's usage patterns and the systems involved).
Ropid
Profile Joined March 2009
Germany3557 Posts
Last Edited: 2015-03-08 17:16:07
March 08 2015 17:15 GMT
#12045
@spinesheath:

Can't it just mean that you are thinking about data structures beginning with what's your input data and ending with what's your output data, then let everything else in-between follow from there (also by describing the data you'll use there), while ignoring all OOP stuff like what procedures are tied to the objects and inheritance hierarchies and whatnot?

The data structures you would think about don't necessarily have to exist. You could think about data you'd like to have, like in that game perhaps stuff like "a list of all entities that need a change after the user clicked x", but then when you implement that, C++ probably has something neat you can use like a function producing streams of stuff that you can pipe into another function or whatever.
"My goal is to replace my soul with coffee and become immortal."
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
March 08 2015 17:42 GMT
#12046
On March 09 2015 02:15 Ropid wrote:
@spinesheath:

Can't it just mean that you are thinking about data structures beginning with what's your input data and ending with what's your output data, then let everything else in-between follow from there (also by describing the data you'll use there), while ignoring all OOP stuff like what procedures are tied to the objects and inheritance hierarchies and whatnot?

The data structures you would think about don't necessarily have to exist. You could think about data you'd like to have, like in that game perhaps stuff like "a list of all entities that need a change after the user clicked x", but then when you implement that, C++ probably has something neat you can use like a function producing streams of stuff that you can pipe into another function or whatever.

If you're questioning the definition of DoD, certainly it might be something completly different, and as is common with buzzwordy design principles like that, there usually isn't a commonly agreed upon definition anyways.

However, if you want to do something with you data to increase performance, vectorizing your class' fields across all instances is the probably the best you can do. Especially if you can apply algorithms that utilize SIMD instructions.
If you have a good reason to disagree with the above, please tell me. Thank you.
Ropid
Profile Joined March 2009
Germany3557 Posts
March 08 2015 20:02 GMT
#12047
On March 09 2015 02:42 spinesheath wrote:
Show nested quote +
On March 09 2015 02:15 Ropid wrote:
@spinesheath:

Can't it just mean that you are thinking about data structures beginning with what's your input data and ending with what's your output data, then let everything else in-between follow from there (also by describing the data you'll use there), while ignoring all OOP stuff like what procedures are tied to the objects and inheritance hierarchies and whatnot?

The data structures you would think about don't necessarily have to exist. You could think about data you'd like to have, like in that game perhaps stuff like "a list of all entities that need a change after the user clicked x", but then when you implement that, C++ probably has something neat you can use like a function producing streams of stuff that you can pipe into another function or whatever.

If you're questioning the definition of DoD, certainly it might be something completly different, and as is common with buzzwordy design principles like that, there usually isn't a commonly agreed upon definition anyways.

However, if you want to do something with you data to increase performance, vectorizing your class' fields across all instances is the probably the best you can do. Especially if you can apply algorithms that utilize SIMD instructions.

It seems super hard to add parallelization and concurrency to normal OO style programs. That data driven stuff feels like it might help with that.

Parallelization of work that needs to be applied to each object seems obvious enough. It will only be fine if the objects are completely separate and the work has no side-effects.

Concurrency seems more interesting. Perhaps if you think about processing a list of stuff as something that takes that list as an input stream of objects that then produces an output stream of new objects, you could try to use some sort of pipes to get use out of multiple threads?
"My goal is to replace my soul with coffee and become immortal."
teamamerica
Profile Blog Joined July 2010
United States958 Posts
Last Edited: 2015-03-09 11:33:17
March 09 2015 11:30 GMT
#12048
On March 09 2015 00:47 spinesheath wrote:
Show nested quote +
On March 08 2015 21:32 sabas123 wrote:
On March 08 2015 21:24 spinesheath wrote:
On March 08 2015 21:00 sabas123 wrote:
My idea was to have some kind of sorter that will do the filter and then give that to the function/system/processor (how ever you want to call it).

My intention isn't performance, but from what I read it should be possible to have faster performance with this kind of architecture then the traditional class hierarchy

The point of entity component designs is something along the lines of avoiding having to define a class for each possible combination of traits an object could have (like renderable, collidable, controllable and so on). It's about using composition instead of inheritance. It's not about performance and it's very unlikely that it has any performance advantages over a inheritance based system in a language like C++ simply because C++ virtual method invocation is about as fast as it gets if you need variable behavior among a list of objects.

In other languages this might be entirely different, specifically if methods aren't defined per class, but instead per instance. In that case you'd only ever need the methods of your few system instances instead of your many entity instances.

I saw some speakers at cpp con from google and sony I think talk about how to stepped to data oriented designs (from my knowledge entity based systems == DoD) because it had better performance and more maintainable code.

Data oriented design seems to be about placing similar data in a contiguous part of memory so it can be mass-processed more efficiently.

If a normal class has fields a, b and c, each instance looks just about like this in memory: (x, a, b, c) where x is, for example, the v-table pointer. And then those instances are potentially sprinkled all across your memory. That's "bad" if you want to do an operation on all fields a of all instances.

DoD suggests that instead of having fields a, b and c per instance, you have for example 3 vectors for the class - not the instance, one for each field, and if you need to access the "field" of a given instance, you look it up by index, for example. The key point being that all fields "a" are placed in contiguous memory.
I worked with something like that for my bachelor's thesis, but I still had normal instances and only copied the data into vectors before using it. The idea there was to lay the data out in a way that allows better usage of SIMD instructions. However this was for a molecular dynamics simulation on a supercomputer. Hardly the kind of performance requirements you'll face everyday.

Now, what you are doing - a list of components for each entity instance, and each component is an instance with normal fields: That's not DoD. You might be able to use a data holder like described in DoD for each kind of component and it'll be DoD, but as of now you're not doing that, and I wouldn't recommend it. For example because you'll have to do a lot more than just change your data storage layout to achieve a performance gain. And you more than likely won't need it.


Vectorizing by lists of instance sounds like what a typical columnar data store tries to do (I've never worked with it personally but I think we some Teradata to store data for offline processing about stuff like customer retention models, etc.). Same reasons - faster to process column A when its (aaaaa,bbbbb,ccccc) then ((a,b,c),(a,b,c)...), so it's useful for some types of workloads (offline, batch processing) vs OLTP worloads I'd assume.

Sorry for all my twattery earlier guys. Anyway, today's daily dumb java question.

Checking some Java options and it mentions for -Xmx (max heap)
>> This value must be a multiple of 1024 and greater than 2 MB
But setting -Xmx1024k (minimum size for Xms) works fine for me.

+ Show Spoiler +


$ java -Xmx1024k -Xms1024k -server -XX:+PrintCommandLineFlags 2>/dev/null
-XX:InitialHeapSize=[b]1048576[/b] -XX:MaxHeapSize=[b]1048576[/b] -XX:+PrintCommandLineFlags -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:-UseLargePagesIndividualAllocation -XX:+UseParallelGC



Also - anyone see difference between -client and -server options? I'm just checking them out on my Windows laptop so maybe it's different on different JDK but I see them as setting memory options to same

+ Show Spoiler +


$ java -client -XX:+PrintCommandLineFlags 2>/dev/null
-XX:InitialHeapSize=266849216 -XX:MaxHeapSize=4269587456 -XX:+PrintCommandLineFlags -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:-UseLargePagesIndividualAllocation -XX:+UseParallelGC
[Mon Mar 09 04:28:55 zebra@ZEBRA:~/personal ]
$ java -server -XX:+PrintCommandLineFlags 2>/dev/null
-XX:InitialHeapSize=266849216 -XX:MaxHeapSize=4269587456 -XX:+PrintCommandLineFlags -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:-UseLargePagesIndividualAllocation -XX:+UseParallelGC



edit: tried to post question on SO "Java Minimum Xmx option" and it kept rejecting my question as not having a good enough title so I gave up
RIP GOMTV. RIP PROLEAGUE.
Ben...
Profile Joined January 2011
Canada3485 Posts
Last Edited: 2015-03-09 14:21:03
March 09 2015 14:20 GMT
#12049
On March 09 2015 20:30 teamamerica wrote:
edit: tried to post question on SO "Java Minimum Xmx option" and it kept rejecting my question as not having a good enough title so I gave up

Been reading about that kind of thing happening a lot lately from a few different people on forums. People will try and post perfectly valid questions that haven't been answered before and will get shut down because of some tiny nitpick. There was an interesting blog from a person who was a longtime, top of the pack SO contributor who said that it's getting to the point where new users are being chased away because some of the powers that be are becoming insanely pedantic about everything and are blocking valid questions simply because they don't like how they are worded or the topic. I've been meaning to start contributing there, but every time I go to, it just feels like a waste of time. I've also noticed the signal to noise ratio there is getting really bad when it comes to responses.
"Cliiiiiiiiiiiiiiiiide" -Tastosis
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
March 09 2015 16:01 GMT
#12050
Currently im writing alot of structs and giving them an unique id to identify them later.

constantly looking up the latest id I putted in/looking up the id of the struct is a bit of an pain. any way I can do this automatically with something like an enum?
The harder it becomes, the more you should focus on the basics.
ThatGuy
Profile Blog Joined April 2008
Canada695 Posts
March 09 2015 17:32 GMT
#12051
On March 10 2015 01:01 sabas123 wrote:
Currently im writing alot of structs and giving them an unique id to identify them later.

constantly looking up the latest id I putted in/looking up the id of the struct is a bit of an pain. any way I can do this automatically with something like an enum?


You could use a map/hashmap to pair an id with the struct itself, would this suit your needs?
RoyGBiv_13
Profile Blog Joined August 2010
United States1275 Posts
Last Edited: 2015-03-09 17:57:48
March 09 2015 17:55 GMT
#12052
On March 10 2015 01:01 sabas123 wrote:
Currently im writing alot of structs and giving them an unique id to identify them later.

constantly looking up the latest id I putted in/looking up the id of the struct is a bit of an pain. any way I can do this automatically with something like an enum?


I would use a combination of stringification macros, and post-compilation symbol tables. It's not a silver bullet, but now you only have to remember the index, not the entire ID. I have my build script setup to open up the symbol table after each compilation so I can quickly search for symbol names rather than grepping my code. Of course, a debugger is a better alternative.

Examples always help:

+ Show Spoiler +


#define struct_name(s) struct foobar_#s

struct_name(1) {
...
}

struct_name(2) {
...
}

struct_name(1).addfunct = adder;
struct_name(2).data = 11;

Any sufficiently advanced technology is indistinguishable from magic
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
March 09 2015 17:57 GMT
#12053
On March 10 2015 02:32 ThatGuy wrote:
Show nested quote +
On March 10 2015 01:01 sabas123 wrote:
Currently im writing alot of structs and giving them an unique id to identify them later.

constantly looking up the latest id I putted in/looking up the id of the struct is a bit of an pain. any way I can do this automatically with something like an enum?


You could use a map/hashmap to pair an id with the struct itself, would this suit your needs?

I geuss I could try that.
The harder it becomes, the more you should focus on the basics.
Ropid
Profile Joined March 2009
Germany3557 Posts
Last Edited: 2015-03-09 18:02:40
March 09 2015 18:01 GMT
#12054
On March 10 2015 01:01 sabas123 wrote:
Currently im writing alot of structs and giving them an unique id to identify them later.

constantly looking up the latest id I putted in/looking up the id of the struct is a bit of an pain. any way I can do this automatically with something like an enum?

The OOP way is using "virtual" functions. Behind the scenes, those are basically a pointer to a function getting added to the data structure. When you then have a base class and derive a bunch of specialized classes from it, and you then have a collection of elements of that base class, you can call that virtual function on any element of your collection, and what will run is the function from the specialized class without any type casting needed.

No idea if that's better or worse than doing things manually like what you're doing right now with your IDs.
"My goal is to replace my soul with coffee and become immortal."
berated-
Profile Blog Joined February 2007
United States1134 Posts
Last Edited: 2015-03-09 23:33:55
March 09 2015 23:32 GMT
#12055
On March 09 2015 20:30 teamamerica wrote:
Show nested quote +
On March 09 2015 00:47 spinesheath wrote:
On March 08 2015 21:32 sabas123 wrote:
On March 08 2015 21:24 spinesheath wrote:
On March 08 2015 21:00 sabas123 wrote:
My idea was to have some kind of sorter that will do the filter and then give that to the function/system/processor (how ever you want to call it).

My intention isn't performance, but from what I read it should be possible to have faster performance with this kind of architecture then the traditional class hierarchy

The point of entity component designs is something along the lines of avoiding having to define a class for each possible combination of traits an object could have (like renderable, collidable, controllable and so on). It's about using composition instead of inheritance. It's not about performance and it's very unlikely that it has any performance advantages over a inheritance based system in a language like C++ simply because C++ virtual method invocation is about as fast as it gets if you need variable behavior among a list of objects.

In other languages this might be entirely different, specifically if methods aren't defined per class, but instead per instance. In that case you'd only ever need the methods of your few system instances instead of your many entity instances.

I saw some speakers at cpp con from google and sony I think talk about how to stepped to data oriented designs (from my knowledge entity based systems == DoD) because it had better performance and more maintainable code.

Data oriented design seems to be about placing similar data in a contiguous part of memory so it can be mass-processed more efficiently.

If a normal class has fields a, b and c, each instance looks just about like this in memory: (x, a, b, c) where x is, for example, the v-table pointer. And then those instances are potentially sprinkled all across your memory. That's "bad" if you want to do an operation on all fields a of all instances.

DoD suggests that instead of having fields a, b and c per instance, you have for example 3 vectors for the class - not the instance, one for each field, and if you need to access the "field" of a given instance, you look it up by index, for example. The key point being that all fields "a" are placed in contiguous memory.
I worked with something like that for my bachelor's thesis, but I still had normal instances and only copied the data into vectors before using it. The idea there was to lay the data out in a way that allows better usage of SIMD instructions. However this was for a molecular dynamics simulation on a supercomputer. Hardly the kind of performance requirements you'll face everyday.

Now, what you are doing - a list of components for each entity instance, and each component is an instance with normal fields: That's not DoD. You might be able to use a data holder like described in DoD for each kind of component and it'll be DoD, but as of now you're not doing that, and I wouldn't recommend it. For example because you'll have to do a lot more than just change your data storage layout to achieve a performance gain. And you more than likely won't need it.


Vectorizing by lists of instance sounds like what a typical columnar data store tries to do (I've never worked with it personally but I think we some Teradata to store data for offline processing about stuff like customer retention models, etc.). Same reasons - faster to process column A when its (aaaaa,bbbbb,ccccc) then ((a,b,c),(a,b,c)...), so it's useful for some types of workloads (offline, batch processing) vs OLTP worloads I'd assume.

Sorry for all my twattery earlier guys. Anyway, today's daily dumb java question.

Checking some Java options and it mentions for -Xmx (max heap)
>> This value must be a multiple of 1024 and greater than 2 MB
But setting -Xmx1024k (minimum size for Xms) works fine for me.

+ Show Spoiler +


$ java -Xmx1024k -Xms1024k -server -XX:+PrintCommandLineFlags 2>/dev/null
-XX:InitialHeapSize=[b]1048576[/b] -XX:MaxHeapSize=[b]1048576[/b] -XX:+PrintCommandLineFlags -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:-UseLargePagesIndividualAllocation -XX:+UseParallelGC



Also - anyone see difference between -client and -server options? I'm just checking them out on my Windows laptop so maybe it's different on different JDK but I see them as setting memory options to same

+ Show Spoiler +


$ java -client -XX:+PrintCommandLineFlags 2>/dev/null
-XX:InitialHeapSize=266849216 -XX:MaxHeapSize=4269587456 -XX:+PrintCommandLineFlags -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:-UseLargePagesIndividualAllocation -XX:+UseParallelGC
[Mon Mar 09 04:28:55 zebra@ZEBRA:~/personal ]
$ java -server -XX:+PrintCommandLineFlags 2>/dev/null
-XX:InitialHeapSize=266849216 -XX:MaxHeapSize=4269587456 -XX:+PrintCommandLineFlags -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:-UseLargePagesIndividualAllocation -XX:+UseParallelGC



edit: tried to post question on SO "Java Minimum Xmx option" and it kept rejecting my question as not having a good enough title so I gave up


What version of java are you running? All of the command line options are specific to the jvm you are running on.

From the java docs..
-server
The 64-bit version of the JDK supports only the Server VM, so in that case the option is implicit.
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
March 11 2015 19:17 GMT
#12056
On March 10 2015 03:01 Ropid wrote:
Show nested quote +
On March 10 2015 01:01 sabas123 wrote:
Currently im writing alot of structs and giving them an unique id to identify them later.

constantly looking up the latest id I putted in/looking up the id of the struct is a bit of an pain. any way I can do this automatically with something like an enum?

The OOP way is using "virtual" functions. Behind the scenes, those are basically a pointer to a function getting added to the data structure. When you then have a base class and derive a bunch of specialized classes from it, and you then have a collection of elements of that base class, you can call that virtual function on any element of your collection, and what will run is the function from the specialized class without any type casting needed.

No idea if that's better or worse than doing things manually like what you're doing right now with your IDs.

My structs only will have variables not fuction. so I can't use them:/
The harder it becomes, the more you should focus on the basics.
A3th3r
Profile Blog Joined September 2014
United States319 Posts
March 11 2015 20:32 GMT
#12057
trying to program Bluetooth code for the MSP430 is really difficult! Dah! It seriously is a tool made for employee comfort & not employer production.
stale trite schlub
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
March 11 2015 21:53 GMT
#12058
lets go boys, registration is open now!

https://code.google.com/codejam
The harder it becomes, the more you should focus on the basics.
enigmaticcam
Profile Blog Joined October 2010
United States280 Posts
Last Edited: 2015-03-11 22:30:06
March 11 2015 22:05 GMT
#12059
Ok, so I have a programming problem I'm trying to solve. Any help would be appreciated.

I'm scheduling users to daily jobs for a given month. I have a specific set of users and a specific set of jobs. However, one day might not have the same set of jobs as another. There are various hard rules, such as not allowing one user to be scheduled more than twice in a day - hard rules can't be broken. There are various soft rules, such as scheduling the same user to the same job two days in a row - soft rules can be broken. I want to write a program that will give me the best combination for a given month - one combination is better than another if it breaks less soft rules (no combination is good if it breaks any hard rule). I also want to be able to add or remove rules easily, so there's no dependency on the rules themselves, only that they are either hard or soft.

The difficulty I'm having is that you can't really put a score on a user to a job unless you've accounted for all other jobs due to the nature of the rules. For example, I can't say that adding John to job 2 on day3 is good or bad unless I know if he was already added on that same day. So it seems to me then that dynamic programming is out because you can't break the problem down into smaller components to solve. Also, I don't think brute forcing will work if you have a large amount of job types, users, and jobs per day. Too many variations.

Any help you can offer would be appreciated!
Zocat
Profile Joined April 2010
Germany2229 Posts
March 11 2015 23:02 GMT
#12060
Do you need to find the best solution (global optima) or a "good enough" solution (local optima)?

What is the rough user/job size? Hundreds, thousands, millions, unlimited?

Adding / removing rules depends on your rule complexity. Changing a rule can be easy (not working 3 days in a row), but adding a completely new rule might be complicated (user X doesn't like to do job Y, but he can do it if necessary).

If you don't need the global optima I would look into genetic algorithms. The fitness function sounds easy enough to implement with your set of rules and hard-rule breaking offspring can die off immediately.
Prev 1 601 602 603 604 605 1031 Next
Please log in or register to reply.
Live Events Refresh
WardiTV European League
12:00
Swiss Groups Day 2
WardiTV744
TKL 396
Liquipedia
FEL
12:00
Cracov 2025: Qualifier #2
IndyStarCraft 310
CranKy Ducklings93
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
TKL 396
IndyStarCraft 310
Rex 119
MindelVK 39
StarCraft: Brood War
Sea 11032
Calm 9514
Rain 7180
Bisu 2849
Horang2 2292
Hyuk 1365
Jaedong 1317
Shuttle 516
Rush 430
EffOrt 300
[ Show more ]
Stork 282
Leta 270
Last 240
PianO 210
Mini 206
ToSsGirL 156
Hyun 140
ZerO 95
Movie 79
hero 55
TY 53
Sea.KH 41
JYJ40
Killer 35
JulyZerg 29
ajuk12(nOOB) 22
HiyA 20
GoRush 19
Free 19
zelot 19
Terrorterran 18
Sacsri 17
Barracks 16
Icarus 6
ivOry 2
Stormgate
NightEnD21
Dota 2
qojqva3130
XcaliburYe514
canceldota91
League of Legends
singsing2904
Counter-Strike
x6flipin739
zeus453
Heroes of the Storm
Khaldor354
Other Games
Gorgc2822
B2W.Neo1336
DeMusliM533
Happy390
Fuzer 389
crisheroes359
Pyrionflax337
XaKoH 263
Hui .235
RotterdaM143
ArmadaUGS66
KnowMe53
ZerO(Twitch)18
Organizations
StarCraft: Brood War
CasterMuse 25
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• StrangeGG 38
• iHatsuTV 6
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV771
• Ler42
Upcoming Events
BSL: ProLeague
5h 12m
Dewalt vs Bonyth
Replay Cast
1d 11h
Sparkling Tuna Cup
1d 21h
WardiTV European League
2 days
The PondCast
2 days
Replay Cast
3 days
RSL Revival
3 days
ByuN vs SHIN
Clem vs Reynor
Replay Cast
4 days
RSL Revival
4 days
Classic vs Cure
FEL
5 days
[ Show More ]
RSL Revival
5 days
FEL
5 days
FEL
6 days
Sparkling Tuna Cup
6 days
RSL Revival
6 days
Liquipedia Results

Completed

BSL 2v2 Season 3
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL Season 20
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Jiahua Invitational
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
2025 ACS Season 2
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.