Code Monkey home page Code Monkey logo

Comments (48)

Hywan avatar Hywan commented on June 19, 2024

Thoughts @hoaproject/hoackers?

from core.

Jir4 avatar Jir4 commented on June 19, 2024

And what happens to Hoa\Core\Data ? If i understand, it is kept in Hoa\Core, why ?

from core.

Hywan avatar Hywan commented on June 19, 2024

@Jir4 Because I am not sure about what to do with this one so far.

from core.

osaris avatar osaris commented on June 19, 2024

That make sense, it would be very interesting to do some benchmarks before/after core splitting to check the real difference on performances (not saying that it'll decrease performances but numbers/data are interesting).

from core.

Jir4 avatar Jir4 commented on June 19, 2024

@osaris ๐Ÿ‘

from core.

Hywan avatar Hywan commented on June 19, 2024

@osaris Also, something else must be quantified but this is really hard: The psychological impact of having a โ€œcoreโ€ for a library. This is something really important. Several people stops at this. The goal is to really continue to split. Please, see #97.

from core.

Hywan avatar Hywan commented on June 19, 2024

I started to split Hoa\Core\Exception and Hoa\Core\Event yesterday night.

from core.

Hywan avatar Hywan commented on June 19, 2024

Hoa\Event is almost over.
Hoa\Exception is under splitting (the repositories have been created).

from core.

Hywan avatar Hywan commented on June 19, 2024

I am starting to update libraries with Hoa\Event and Hoa\Exception.

from core.

Hywan avatar Hywan commented on June 19, 2024

First run. I will continue today if I have time.

from core.

Metalaka avatar Metalaka commented on June 19, 2024

@Hywan Sorry but most of your PR introduce a parse error: https://3v4l.org/vB5Dt

namespace Hoa\Exception {
    class Exception {}
}

namespace Hoa\Database {

    use Hoa\Exception;

    class Exception {}
    // Fatal error: Cannot declare class Hoa\Database\Exception because the name is already in useโ€ฆ
}

from core.

Metalaka avatar Metalaka commented on June 19, 2024

Your should probably remove the use statement.

namespace Hoa\Database;

class Exception extends \Hoa\Exception {}

from core.

Hywan avatar Hywan commented on June 19, 2024

Damned, I tested it on PHP7-nightly and it worked :-/.

from core.

Hywan avatar Hywan commented on June 19, 2024

@Metalaka Fixed.

from core.

Metalaka avatar Metalaka commented on June 19, 2024

Is it always possible to use flex entity ?

namespace Hoa\Database;

use Hoa\Exception as HoaException;

class Exception extends HoaException
{
}

from core.

Hywan avatar Hywan commented on June 19, 2024

@Metalaka I think so.

from core.

Metalaka avatar Metalaka commented on June 19, 2024

@Hywan flex entity seem to work at least for Hoa\Database.

from core.

Hywan avatar Hywan commented on June 19, 2024

@Metalaka Hmm, yes, I shoud have update with the shortest name. Do you think this is required?

from core.

Hywan avatar Hywan commented on June 19, 2024

(anyway, I started to update the code).

from core.

Metalaka avatar Metalaka commented on June 19, 2024

The most important is do the same things everywhere (alias or alias+exception).

from core.

Hywan avatar Hywan commented on June 19, 2024

@Metalaka We use the shortest everywhere. I started to move every library to Hoa\Event. I am updating this issue too.

from core.

Hywan avatar Hywan commented on June 19, 2024

All libraries have been updated to Hoa\Event.

from core.

Hywan avatar Hywan commented on June 19, 2024

All libraries have been updated to Hoa\Exception (final).

from core.

Hywan avatar Hywan commented on June 19, 2024

Hoa\Consistency has been created. I will move the code tomorrow. Hope to start test suites tomorrow too.

from core.

Hywan avatar Hywan commented on June 19, 2024

Hoa\Consistency is OK. Now I will start updating other libraries.

from core.

Hywan avatar Hywan commented on June 19, 2024

All tests are green for Hoa\Protocol split. Now I have to write the test suite of Hoa\Protocol but the integration of the new library is fine!

from core.

Hywan avatar Hywan commented on June 19, 2024

Everything is OK!
I am starting #97.

from core.

Hywan avatar Hywan commented on June 19, 2024

@hoaproject/hoackers Please, I need your help!

  1. What about Hoa\Zformat instead of Hoa\Parameter? Do you think this is better?
  2. What to do with Hoa\Core? See the โ€œNext stepsโ€ Section in #96 (comment) for the questions.

Thanks!

from core.

Jir4 avatar Jir4 commented on June 19, 2024
  1. Why ZFormat ? Meaning ?
  2. I think we should delete Hoa\Core, the Core name scares many users imo, they just wanna use a specific lib but the Core dependancy seems imply that the lib need many others to work

from core.

Hywan avatar Hywan commented on June 19, 2024

@Jir4

  1. zFormat because this is the format we use to express parameters.
  2. Yes, we will โ€œremoveโ€ it, but for legacy code, it must still be present as a repository. We can mark it as deprecated and keep the code as is. Thoughts?

from core.

Jir4 avatar Jir4 commented on June 19, 2024
  1. Ok so ๐Ÿ‘
  2. So we keep it just to avoid a BC break and we will remove it when another BC break occurred ?

from core.

Hywan avatar Hywan commented on June 19, 2024

@Jir4 We will remove it when we will no longer have any downloads. Until we have downloads, we must keep the repository live :-].

from core.

CircleCode avatar CircleCode commented on June 19, 2024

@Hywan the downside of this approach is that we will have downloads (at least for CI systems) so long as it will be availableโ€ฆ
IMHO we should announce an estimated end-of-life

from core.

Hywan avatar Hywan commented on June 19, 2024

@CircleCode Hmmโ€ฆ Every year, we can clean deprecated repositories? So far, we only have Hoa\String (see git.hoa-project.net). How long is enought?

from core.

Jir4 avatar Jir4 commented on June 19, 2024

Several month but not years, we just have to let the time to users to update their legacy code.

from core.

Hywan avatar Hywan commented on June 19, 2024
Success (95 tests, 800/800 methods, 0 void method, 0 skipped method, 180913 assertions)!

Hoa\Zformat has been created. I am removing hoa/core from everywhere :-).

from core.

Hywan avatar Hywan commented on June 19, 2024

All libraries are updated. Now I am running devtools:cs to update the year.

from core.

Hywan avatar Hywan commented on June 19, 2024

Done.

from core.

Hywan avatar Hywan commented on June 19, 2024

Next step is to merge everything and create new snapshots for all libraries. I don't have enough time to do it well if something failed right now. Let see tonight or tomorrow!

from core.

Hywan avatar Hywan commented on June 19, 2024

Done \o/.
Congratulations to everyone ๐ŸŽ† ๐ŸŽ‰ ๐ŸŽˆ!!

from core.

Jir4 avatar Jir4 commented on June 19, 2024

๐Ÿ‘

from core.

Hywan avatar Hywan commented on June 19, 2024

๐Ÿ˜…

from core.

1e1 avatar 1e1 commented on June 19, 2024

๐Ÿ‘
Great job!
I've just read the discussion, do you know what you earn by registering hoa:// in Composer? For projects like the official website, Rulerz, some Liip projectsโ€ฆ

from core.

Hywan avatar Hywan commented on June 19, 2024

@1e1 What we earn? I don't understand.

from core.

Jir4 avatar Jir4 commented on June 19, 2024

I suppose that he speak about performance

from core.

Hywan avatar Hywan commented on June 19, 2024

That's very light. Let me try a small benchmark.

from core.

1e1 avatar 1e1 commented on June 19, 2024

Yeap! (Sorry)

from core.

Hywan avatar Hywan commented on June 19, 2024

tl;dr

Here is small benchmark result when loading Hoa (because we have 1 require autoloaded file):

vs Time (for 1000 runs) Memory
Hoa\Core 18.084s 335408b
Hoa\Consistency 15.959s 56744b
Gain 11.751% ย 83.082%

Time

First script /tmp/a.sh:

for i in `seq 1 1000`; do
    php -r 'require "/usr/local/lib/Hoa/Core/Core.php";'
done

Second script /tmp/b.sh:

for i in `seq 1 1000`; do
    php -r 'require "/usr/local/lib/Hoa/Consistency/Prelude.php";'
done

Time for time:

$ time /tmp/a.sh
/tmp/a.sh  11.37s user 5.64s system 94% cpu 18.084 total

$ time /tmp/b.sh
/tmp/b.sh  9.56s user 5.07s system 91% cpu 15.959 total

That's an improvement of 11.751% at loading time.

Memory

First script /tmp/a.php:

<?php

$a = memory_get_usage();

require '/usr/local/lib/Hoa/Core/Core.php';

var_dump(memory_get_usage() - $a);

Second script /tmp/b.php:

<?php

$a = memory_get_usage();

require '/usr/local/lib/Hoa/Consistency/Prelude.php';

var_dump(memory_get_usage() - $a);

Time to run:

$ php /tmp/a.php
int(335408)

$ php /tmp/b.php
int(56744)

That's an improvement of 278664b, be 272Kb, be 83.082% at initialization per process per run.

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.